package com.zx.platform.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.zx.platform.dao.model.Menus;
import com.zx.platform.dao.model.MenusExample;

public interface MenusDao {

	/**
	 * 新增
	 * 
	 * @param Menus
	 * @return
	 * @throws DataAccessException
	 */
	public Integer add(Menus menus) throws DataAccessException;

	/**
	 * 更新
	 * 
	 * @param Menus
	 * @return
	 * @throws DataAccessException
	 */
	public Integer update(Menus menus) throws DataAccessException;

	/**
	 * 删除
	 * 
	 * @param Menus
	 * @throws DataAccessException
	 */
	public void delete(Menus menus) throws DataAccessException;

	/**
	 * 分页查询
	 * 
	 * @param pageSize
	 * @param pageBegin
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public List<Menus> getPageByExample(int pageSize, int pageBegin,
			MenusExample example) throws DataAccessException;
	/**
	 * 根据Model查找List
	 * @param pageSize
	 * @param pageBegin
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public List<Menus> getListByExample(MenusExample example) throws DataAccessException;
	
	/**
	 * 查找条数
	 * 
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public int countByExample(MenusExample example) throws DataAccessException;
	/**
	 * 根据单Key查找Model
	 * 
	 * @param example
	 * @return
	 * @throws DataAccessException
	 */
	public Menus selectByPrimaryKey(Integer key) throws DataAccessException;
	/**
	 * 根据roleId获得相关联的menuList
	 * @param model
	 * @return
	 * @throws DataAccessException
	 */
	public List getMenusByRoleId(Integer roleId) throws DataAccessException;
}